//
//  AY_BookYiJCell1.m
//  AiYue
//
//  Created by boWen on 2023/11/17.
//

#import "AY_BookYiJCell1.h"

@interface AY_BookYiJCell1 ()
@property (nonatomic,strong) UIView * bg_View;//底部圆角
@property (nonatomic,strong) UILabel * wwxLabel;
@property (nonatomic,strong) UILabel * phoneLabel;
@end

@implementation AY_BookYiJCell1

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addAllSubviewsWithUI];
    }
    return self;
}


- (void)addAllSubviewsWithUI {
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.contentView.backgroundColor = [UIColor whiteColor];
    
    self.bg_View = [AYTool createViewWithFrame:CGRectZero andBg:[UIColor whiteColor] andRadius:YNUM(6) andAddSubView:self.contentView];
    [self.bg_View mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView);
        make.left.equalTo(self.contentView).offset(YNUM(12));
        make.right.equalTo(self.contentView).offset(YNUM(-12));
        make.height.mas_offset(YNUM(78));
    }];

    self.wwxLabel = [AYTool createLabelWithFrame:CGRectZero andText:[NSString stringWithFormat:@"QQ/%@",[AYMMKV getStringForKey:WXSTR]] andTextColor:COLOR(@"#000002") andBgColor:nil andFont:[UIFont systemFontOfSize:YNUM(14)] andLines:1 andRadius:0 andAddSubView:self.bg_View];
    [self.wwxLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.bg_View);
        make.left.equalTo(self.bg_View);
        make.height.mas_offset(YNUM(22));
    }];
    
    
    UIView * nameView = [AYTool createViewWithFrame:CGRectZero andBg:COLOR(@"#FAFAFA") andRadius:YNUM(6) andAddSubView:self.bg_View];
    [nameView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.wwxLabel.mas_bottom).offset(YNUM(8));
        make.left.equalTo(self.bg_View);
        make.right.equalTo(self.bg_View);
        make.bottom.equalTo(self.bg_View.mas_bottom);
    }];
    
    self.wwxField = [[UITextField alloc]init];
    self.wwxField.placeholder = [NSString stringWithFormat:@"请输入QQ/%@",[AYMMKV getStringForKey:WXSTR]];
    self.wwxField.font = [UIFont systemFontOfSize:YNUM(14)];
    [nameView addSubview:self.wwxField];
    [self.wwxField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(nameView).offset(YNUM(16));
        make.right.equalTo(nameView).offset(YNUM(-16));
        make.centerY.equalTo(nameView);
        make.bottom.equalTo(nameView);
    }];
    
    
    UIView * bg_view1 = [AYTool createViewWithFrame:CGRectZero andBg:[UIColor whiteColor] andRadius:YNUM(6) andAddSubView:self.contentView];
    [bg_view1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.bg_View.mas_bottom).offset(YNUM(22));
        make.bottom.equalTo(self.contentView);
        make.left.equalTo(self.contentView).offset(YNUM(12));
        make.right.equalTo(self.contentView).offset(YNUM(-12));
    }];
    self.phoneLabel = [AYTool createLabelWithFrame:CGRectZero andText:@"联系电话（选填）" andTextColor:COLOR(@"#000002") andBgColor:nil andFont:[UIFont systemFontOfSize:YNUM(14)] andLines:1 andRadius:0 andAddSubView:bg_view1];
    [self.phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(bg_view1);
        make.left.equalTo(bg_view1);
        make.height.mas_offset(YNUM(22));
    }];
    
    
    UIView * nameView1 = [AYTool createViewWithFrame:CGRectZero andBg:COLOR(@"#FAFAFA") andRadius:YNUM(6) andAddSubView:bg_view1];
    [nameView1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.phoneLabel.mas_bottom).offset(YNUM(8));
        make.left.equalTo(bg_view1);
        make.right.equalTo(bg_view1);
        make.height.mas_offset(YNUM(48));
    }];
    
    self.phoneField = [[UITextField alloc]init];
    self.phoneField.font = [UIFont systemFontOfSize:YNUM(14)];
    self.phoneField.placeholder = @"请输入联系电话";
    [nameView1 addSubview:self.phoneField];
    [self.phoneField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(nameView1).offset(YNUM(16));
        make.right.equalTo(nameView1).offset(YNUM(-16));
        make.centerY.equalTo(nameView1);
    }];
    
    
}

@end
